package com.wandian.util
{
	import com.wandian.core.BitmapManager;
	import com.wandian.data.GameData;

	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.utils.Dictionary;

	/**
	 * 略缩图帮助类
	 * @author long
	 */
	public class LoadIconUtil
	{
		private static const DICT:Dictionary=new Dictionary();

		public function LoadIconUtil()
		{
		}

		public static function removeIcon(param1:String):void
		{
			if (DICT[param1])
			{
				delete DICT[param1];
			}
			return;
		} 

		public static function addIcon(parentMc:DisplayObjectContainer, url:String, iconW:int=0, iconH:int=0, iconX:Number=0, iconY:Number=0):void
		{
			var image:Bitmap=new Bitmap(GameData.getBitMapDataByCache(url)); //new Bitmap(BitmapManager.instance.getBitmapDataByName(url));
//			if (iconH != 0)
//			{
//				ZoomUtil.imageZoomWH(image, iconW, iconH);
//			}
			image.width=iconW;
			image.height=iconH;
			image.x=iconX;
			image.y=iconY;
			parentMc.addChild(image);
			return;
		} 

	}
}
